<script setup lang="ts">
import { ref, watch } from 'vue';
let age= ref(20)

//监视vue某个属性的变化,oldValue,newValue
watch(age,(newValue,oldValue)=>{
    console.log("oldValue:" +oldValue)
    console.log("newValue:" +newValue)
})
</script>


<template>
    age:<input type="text" v-model="age"/>{{ age }}
</template>